package org.example.leetcode.common._enum;

public enum CodeTemplateEnum implements BaseEnum<String,String>{
    JAVA("JAVA","public class ${className} {\n" +
            "    public static void main(String args[]){\n" +
            "        System.out.println(\"Hello world.\\n\");\n" +
            "    }\n" +
            "}"),
    C("C","#include<stdio.h>\n" +
            "int main()\n" +
            "{\n" +
            "        int i;\n" +
            "        while(scanf(\"%d\",&i)!=EOF)\n" +
            "                printf(\"%d\\n\",i);\n" +
            "        return 0;\n" +
            "}");
    private String language;
    private String template;
    private CodeTemplateEnum(String language,String template){
        this.language=language;
        this.template=template;
    }

    public String getLanguage() {
        return language;
    }

    public String getTemplate() {
        return template;
    }

    @Override
    public String getCode() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }
    public static CodeTemplateEnum getByLanguage(String language){
        for (CodeTemplateEnum value : CodeTemplateEnum.values()) {
            if(value.getLanguage().equals(language)){
                return value;
            }
        }
        return null;
    }
}
